//
//  GRBlankSpace.m
//  YC_GRice
//
//  Created by LiuFeng on 2018/7/19.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GRBlankSpace.h"

@implementation GRBlankSpace

-(void)setContentMode:(BlankContentMode)contentMode {
    switch (contentMode) {
        case GRBlankContentModeBrokenNetwork:{
            _prompt.text     = @"哎呦，你是不是忘记打开网络了~";
            _promptIMG.image = [UIImage imageNamed:@"Blank_1"];
            [self configureButton:@"重新加载" width:100];
        }
            break;
            
        case GRBlankContentModeNotFound:{
            _prompt.text     = @"OH~NO~，服务器出错啦！";
            _promptIMG.image = [UIImage imageNamed:@"Blank_2"];
            [self configureButton:@"刷新试试" width:100];
        }
            break;
            
        case GRBlankContentModeServerDisconnection:{
            _prompt.text     = @"OH~NO~，网络出错啦！";
            _promptIMG.image = [UIImage imageNamed:@"Blank_11"];
            [self configureButton:@"刷新试试" width:100];
        }
            break;
            
        case GRBlankContentModeRequestTimeOut:{
            _prompt.text     = @"咦~你的网路好好好慢呀~";
            _promptIMG.image = [UIImage imageNamed:@"Blank_10"];
            [self configureButton:@"刷新试试" width:100];
        }
            break;

        case GRBlankContentModeSearchLess:{
            _prompt.text     = @"抱歉，没有找到店铺额~";
            _promptIMG.image = [UIImage imageNamed:@"Blank_9"];
        }
            break;
            
        case GRBlankContentModeEmptyShopcar:{
            _prompt.text     = @"正品保证/零利息/灵活分期";
            _promptIMG.image = [UIImage imageNamed:@"Blank_3"];
            [self configureButton:@"立即购物" width:100];
        }
            break;
            
        case GRBlankContentModeEmptyAddress:{
            _prompt.text     = @"您还没添加收货地址呢~";
            _promptIMG.image = [UIImage imageNamed:@"Blank_5"];
            [self configureButton:@"添加收货地址" width:125];
        }
            break;
            
        case GRBlankContentModeEmptyCollection:{
            _prompt.text     = @"还没有关注内容哦，先去逛逛吧~";
            _promptIMG.image = [UIImage imageNamed:@"Blank_7"];
        }
            break;
            
        case GRBlankContentModeEmptyCoupon:{
            _prompt.text     = @"咦~你的优惠券跑去哪里了？";
            _promptIMG.image = [UIImage imageNamed:@"Blank_8"];
        }
            break;
            
        case GRBlankContentModeEmptyEvaluation:{
            _prompt.text     = @"暂无评价";
            _promptIMG.image = [UIImage imageNamed:@"Blank_6"];
        }
            break;
            
        case GRBlankContentModeEmptyOrders:{
            _prompt.text     = @"暂无账单记录";
            _promptIMG.image = [UIImage imageNamed:@"Blank_4"];
        }
            break;

        case GRBlankContentModeEmptyMerchants:{
            _prompt.text         = @"尊敬的用户，该地区尚未入驻商家!\n 龟米正努力铺设市场中，敬请期待！\n 如有合作意向，请联系龟米客服!";
            _prompt.font         = [UIFont systemFontOfSize:12];
            _prompt.textColor  = HEXCOLOR(0x999999);
            _promptIMG.image = [UIImage imageNamed:@"Blank_12"];
            [self configureButton:@"联系客服" width:100];
        }
            break;
            
        case  GRBlankCententModelEmptyInviteFriend:{
            _prompt.text         = @"暂无邀请";
            _prompt.font         = [UIFont systemFontOfSize:15];
            _prompt.textColor  = HEXCOLOR(0x666666);
            _promptIMG.image = [UIImage imageNamed:@"usercenter_48"];
            [_promptBtn.layer setBorderColor:[HEXCOLOR(0x222222) CGColor]];
            [_promptBtn.layer setBorderWidth:1];
            _promptBtn.backgroundColor = [UIColor whiteColor];
            [self configureButton:@"邀请好友" width:71];
            
            
        }
            break;
        case GRBlankContentModeEmptyPaidOrder:{
            _prompt.text     = @"你还没买过单哦~";
            _promptIMG.image = [UIImage imageNamed:@"Blank_13"];
        }
            break;
            
        case GRBlankContentModeEmptyBeenShop:{
            _prompt.text     = @"赶紧去店看看吧~";
            _promptIMG.image = [UIImage imageNamed:@"Blank_14"];
        }
            break;
        case GRBlankContentModeInvalidShop:{
            _prompt.text     = @"该店铺暂停使用";
            _promptIMG.image = [UIImage imageNamed:@"Home_35"];
        }
            break;
        case   GRBlankCententModelEmptyBargainList:{
            _prompt.text     = @"暂无砍价活动";
            _promptIMG.image = [UIImage imageNamed:@"bargaining_07"];
            
        }
            break;
        default:
            break;
    }
    
}

- (void)configureButton:(NSString *)title width:(CGFloat)width {
    _promptBtn.hidden = NO;
    [_promptBtn setTitle:title forState:UIControlStateNormal];
    [_promptBtn mas_updateConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(width);
    }];
}


- (IBAction)didClickAction:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(didClickBlankButton:)]) {
        [self.delegate didClickBlankButton:sender];
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
